<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017\11\2 0002
 * Time: 16:09
 */
namespace app\home\model;


use think\Model;
use think\Db;
use think\Session;
use think\Request;

class Center extends Model{


    /*
     * 修改密码
     * */
    public function update_password($user_pwd,$rand_str,$id){

        $password= md5(md5($user_pwd).$rand_str);

        $res=Db::table('users')->where('user_id',$id)->update(['user_pwd'=>"$password",'user_no'=>$rand_str]);

        if ($res==false){
            return false;
        }else{
            return true;
        }
    }


    /*
     *
     * 文章添加
     * */
    public function save_article($data){



//          $res=Db::table('article')->insert($data);
        $res  = Db::table("article")->insert($data);
        return $res;
        exit;

    }
}